﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarClass
{
    class MilitaryCar: Car
    {
        public MilitaryCar(String name)
            : base(name)
        {
            gun = true;
        }

        private Boolean gun;

        public Boolean Gun
        {
            get { return gun; }
            set 
            {
                if (value == true | value == false) gun = value;
                else throw new Exception("введено недопустимое булево значение!!!");
            }
        }

        public void Shoot()
        {
            Console.WriteLine("огонь!");
        }
    }
}
